package top.minuy.structure.graph.search;

import top.minuy.res.graph.GraphRes;
import top.minuy.structure.graph.representations.table.Graph;
import top.minuy.structure.graph.search.breadth.GraphBFS;
import top.minuy.structure.graph.search.depth.GraphDFS;

/**
 * @author Minuy
 * @time 8:38
 * @date 2021/11/27
 */
public class Test {
    public static void main(String[] args) {
        Graph g = new Graph(GraphRes.G_DIRECTED_01, true);

        System.out.println("有向图的深度优先遍历：");
        GraphDFS dfs = new GraphDFS(g);
        System.out.println("pre : "+dfs.pre());
        System.out.println("post : "+dfs.post());

        System.out.println("有向图的广度优先遍历：");
        GraphBFS bfs = new GraphBFS(g);
        System.out.println("order : "+bfs.order());
    }
}
